package com.gialen.tools.dao.repository.gialen;

import com.gialen.common.model.PageRequest;
import com.gialen.tools.dao.dto.ActivityUserDetailDto;
import com.gialen.tools.dao.dto.CommunityDto;
import com.gialen.tools.dao.entity.gialen.BlcCustomer;
import com.gialen.tools.dao.entity.gialen.BlcCustomerExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

@org.springframework.stereotype.Repository
public interface BlcCustomerMapper {

    /**
     * 统计店董的总社群数据
     * @param directorId
     * @return
     */
    CommunityDto countTotalNumForDirector(@Param("directorId") Long directorId, @Param("userName") String userName);

    /**
     * 统计店董的月新增店经数量
     * @param directorId
     * @param month
     * @return
     */
    Integer countMonthManagerNumForDirector(@Param("directorId") Long directorId, @Param("month") Integer month);

    /**
     * 统计店董的新增店主和vip数量
     * @param directorId
     * @param month
     * @return
     */
    CommunityDto countStoreAndVipNumForDirector(@Param("directorId") Long directorId, @Param("month") Integer month, @Param("day") Integer day);

    /**
     * 查询店董的月新增下级用户列表
     * @param directorId
     * @param childType
     * @param month
     * @param page
     * @return
     */
    List<BlcCustomer> getMonthUserChildListForDirector(@Param("directorId") Long directorId, @Param("childType") Byte childType,
                                                       @Param("month") Integer month, @Param("page") PageRequest page);

    /**
     * 查询店董的月新增vip列表
     * @param directorId
     * @param day
     * @param month
     * @param page
     * @return
     */
    List<CommunityDto> getMonthNewVipListForDirector(@Param("directorId") Long directorId, @Param("day") Integer day,
                                                     @Param("month") Integer month, @Param("page") PageRequest page,
                                                     @Param("storeName") String storeName);


    /**
     * 统计店董的月度 有新增vip的店主数量
     * @param directorId
     * @param month
     * @return
     */
    Long countMonthHasNewVipStoreNumForDirector(@Param("directorId") Long directorId, @Param("month") Integer month, @Param("storeName") String storeName);
    /**
     * 统计店经的店经和直接店主数
     * @param managerId
     * @return
     */
    CommunityDto countDirectStoreAndManagerNumForManager(@Param("managerId") Long managerId, @Param("userName") String userName);

    /**
     * 统计店经的月新增店经和直接店主数
     * @param managerId
     * @param countUserType
     * @param month
     * @return
     */
    Integer countMonthDirectStoreAndManagerNumForManager(@Param("managerId") Long managerId, @Param("countUserType") Byte countUserType, @Param("month") Integer month);

    /**
     * 获取店经的间接店经或vip列表
     * @param userId
     * @param childType
     * @param page
     * @return
     */
    List<BlcCustomer> getIndirectStoreOrVipListForManager(@Param("managerId") Long userId, @Param("childType") Byte childType, @Param("page") PageRequest page, @Param("month") Integer month, @Param("userName") String userName);

    /**
     * 查询店经的月新增店经和直接店主列表
     * @param userId
     * @param childType
     * @param page
     * @param month
     * @return
     */
    List<BlcCustomer> getMonthManagerOrDirectStoreListForManager(@Param("managerId") Long userId, @Param("childType") Byte childType, @Param("page") PageRequest page, @Param("month") Integer month);

    /**
     * 统计店董的活跃或静默店主数量
     * @param directorId
     * @param month
     * @param dataType
     * @param storeName
     * @return
     */
    Long countActivityOrSilenceStoreTotalForDirector(@Param("directorId") Long directorId, @Param("month") Integer month,
                                          @Param("dataType") Byte dataType, @Param("storeName") String storeName);

    /**
     * 查询店董的活跃或静默店主列表
     * @param directorId
     * @param month
     * @param dataType
     * @param pageRequest
     * @param storeName
     * @return
     */
    List<ActivityUserDetailDto> getActivityOrSilenceStoreListForDirector(@Param("directorId") Long directorId, @Param("month") Integer month,
                                                                         @Param("dataType") Byte dataType, @Param("page") PageRequest pageRequest,
                                                                         @Param("storeName") String storeName);


    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    long countByExample(BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int deleteByExample(BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Long customerId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int insert(BlcCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int insertSelective(BlcCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    List<BlcCustomer> selectByExampleWithBLOBs(BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    List<BlcCustomer> selectByExample(BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    BlcCustomer selectByPrimaryKey(Long customerId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") BlcCustomer record, @Param("example") BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int updateByExampleWithBLOBs(@Param("record") BlcCustomer record, @Param("example") BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") BlcCustomer record, @Param("example") BlcCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(BlcCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int updateByPrimaryKeyWithBLOBs(BlcCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table blc_customer
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(BlcCustomer record);
}